﻿Imports DTO
Imports System.Data.OleDb
Public Class BangDiemDao
    Public Shared Function InsertBangDiem(ByVal mahs As Integer, ByVal mamon As Integer, ByVal hocky As Integer, ByVal malop As Integer, ByVal diem15phut As Double, ByVal diem1tiet As Double, ByVal diemcuoiky As Double) As Boolean
        Dim cn As OleDbConnection = DataProvider.ConnectDB()
        Dim sql = "insert into KETQUA(MaHS,MaMH,HocKy,MaLop,Diem15,Diem1Tiet,DiemCK) values (?,?,?,?,?,?,?)"
        Dim cmd As New OleDbCommand(sql, cn)
        cmd.Parameters.Add("@MaHS", OleDbType.Integer)
        cmd.Parameters.Add("@MaMH", OleDbType.Integer)
        cmd.Parameters.Add("@HocKy", OleDbType.Integer)
        cmd.Parameters.Add("@MaLop", OleDbType.Integer)
        cmd.Parameters.Add("@Diem15", OleDbType.Double)
        cmd.Parameters.Add("@Diem1Tiet", OleDbType.Double)
        cmd.Parameters.Add("@DiemCK", OleDbType.Double)

        cmd.Parameters("@MaHS").Value = mahs
        cmd.Parameters("@MaMH").Value = mamon
        cmd.Parameters("@HocKy").Value = hocky
        cmd.Parameters("@MaLop").Value = malop
        cmd.Parameters("@Diem15").Value = diem15phut
        cmd.Parameters("@Diem1Tiet").Value = diem1tiet
        cmd.Parameters("@DiemCK").Value = diemcuoiky

        cmd.ExecuteNonQuery()
        cn.Close()
        Return True
    End Function
End Class
